package com.example.config;

import com.example.interceptor.LoginInterExecption;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description //TODO
 * @Date 2022/9/21 14:05
 * @Author cxy
 **/
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    LoginInterExecption loginInterExecption;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterExecption).addPathPatterns("/**").excludePathPatterns("/competition/enroll/1");
    }
}
